<%@ include file="/taglibs.jsp" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 

<head>
		<title>北京邮电大学学生党员在线学习中心</title>

		<link href="${ctx}/css/pagination.css" rel="stylesheet" type="text/css" />
		<link type="text/css" rel="stylesheet" href="${ctx}/styles/jquery-ui-1.8.16.custom.css" />
		<script type="text/javascript" src="${ctx}/ckeditor/ckeditor.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-1.6.2.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-datepicker.js"></script>
		<script type="text/javascript" src="${ctx}/scripts/jquery-ui-1.8.16.custom.min.js"></script>
		
		<script type="text/javascript">
		  function new_topic()
	      {
			   var title = document.getElementById("title");
			   var editor_data = CKEDITOR.instances.content.getData();
				
			   if(title.value.replace(/(^\s*)/g, "") == "")
			   {
			       alert("请输入标题!");
			       title.focus();
			       return false;
			   }
			   
			   if(title.value.length > 60) {
				   alert("标题超过了60个字符，请重新输入标题");
				   title.focus();
				   return false;
			   }
			   
			   
			   if(editor_data==null || editor_data==""){
					alert("请输入发布的内容");
					CKEDITOR.instances.content.focus();
					return false;
				}
			   
	    }
    </script>
    
    
     <script type="text/javascript">
		$(function(){
			var flag = '<%=request.getAttribute("flag") %>';
			var data = "";
			if(flag==1){
				$('#links').attr("href","${ctx}/AdminLearnCenterAction_adminLearnCenter?flag=1");
			}else if(flag==2){
				$('#links').attr("href","${ctx}/AdminLearnCenterAction_adminLearnCenter?flag=2");
			}else if(flag==3){
				$('#links').attr("href","${ctx}/AdminLearnCenterAction_adminLearnCenter?flag=3");
			}else if(flag==4){
				$('#links').attr("href","${ctx}/AdminLearnCenterAction_adminLearnCenter?flag=4");
			}
		});
	
	</script>
    
 
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/AdminLearnCenterAction_adminLearnCenter">学习园地管理</a>&nbsp;&nbsp;>&nbsp;&nbsp;<a  id="links" href=""><s:property value="moduleName"/></a>&nbsp;&nbsp;>&nbsp;&nbsp;<span style="color:black;">发布<s:property value="moduleName"/></span></div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>

<div style="clear:both; height:20px;">&nbsp;</div>

<div style="margin-left:auto; margin-right:auto; width:96%;">
		<form name="postLearnCenter" action="AdminLearnCenterAction_postLearnCenter" method="post" id="postLearnCenter" >
		  <table>
			<tr>
				<td >
				<b>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
				</td>
 				<td >
 				<input type="text" name="title" id="title"  maxlength="60" style="width:99%" value=""/>
				</td>
			</tr>
			<tr>
				<td>
				<b>内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
				</td>
 				<td >
 					<ckfinder:setupCKEditor editor="content" basePath="ckfinder"/>
			        <ckeditor:editor basePath="ckeditor/" editor="content" value="请在此处填写内容，内容不能为空" /> 					
				</td>
			</tr>
		</table>
		<br>
		<div style="text-align:center;">
		<input id="posttopic" name="posttopic" type="submit" onclick="return new_topic();"   value="发布" class="input-button" />&nbsp;&nbsp;&nbsp;&nbsp;
		<input id="history" name="history" type="button" class="input-button" value="返回"  onclick="window.location.href='javascript:history.go(-1);'"/>
		</div>
		
		 <input type="hidden" name="pageNow" value="1">
		 <input type="hidden" name="flag" value="${flag}">
		 <input type="hidden" name="queryTitle" value="<s:property value="queryTitle"/>">
		</form>
</div>

